Skip to content

Comments

Fix projectile strike source in Damage_PVE_Inner#161

Open
CedaryCat wants to merge 4 commits intoSignatureBeef:upcomingfrom
CedaryCat:upcoming
Open

Fix projectile strike source in Damage_PVE_Inner#161
CedaryCat wants to merge 4 commits intoSignatureBeef:upcomingfrom
CedaryCat:upcoming

Conversation

@CedaryCat
Copy link

Align Projectile.Damage_PVE_Inner with Projectile.Damage by using ldarg_0 (the projectile instance) as the NPC strike source.

@SignatureBeef
Copy link
Owner

is this specific to 145+ ? if so can you retain previous logic where applicable
e.g. #if TerrariaServer_1450_OrAbove .. then this new logic #else existing

future versions may switch compile time logic with whatever the input binary is, so it's useful to read this information directly in the patch.

@CedaryCat
Copy link
Author

Yep — Projectile.Damage_PVE_Inner is the 1.4.5 split from Projectile.Damage, so older versions still go through the existing Projectile.Damage branch.

This fix is just correcting the strike source to ldarg_0 (the projectile); the NPC parameter there is the hit target.

And yeah, wrapping that case in a 145+ #if makes the version split much clearer in the patch.

@SignatureBeef
Copy link
Owner

apologies for the confusion @CedaryCat - i was moreso stating if this patch is only relevant to 145+ then the conditional else would need to retain the old logic too. The case itself won't matter so much as it wont be present in older versions - however, I have actually just taken a look and now understand the actual issue.

I agree with the original patch where ldarg_0/this is passed through - at the moment its invoking an instance and passing through itself incorrectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants